package com.service.impl;

import com.mapper.HydropowerMapper;
import com.pojo.Hydropower;
import com.service.HydropowerService;
import com.vo.HydropowerVo;
import com.vo.LineVo;
import com.vo.shuidianVo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("hydropowerService")
public class HydropowerServiceImpl implements HydropowerService {
    @Resource
    private HydropowerMapper hydropowerMapper;
    @Override
    public String selectMaxByplotid(Integer plotid) {
        String i = hydropowerMapper.selectMax(plotid);
        if(i==null){
            return  "0";
        }else {
            return i;
        }

    }

    @Override
    public Hydropower selectHydropById(Integer id) {
        Hydropower hydropower = hydropowerMapper.selectHydropById(id);
        return hydropower;
    }

    @Override
    public int addHyDropWater(Hydropower hydropower) {
        int i = hydropowerMapper.addHyDropWater(hydropower);
        return i;
    }
    @Override
    public int addHyDropE(HydropowerVo hydropowerVo) {
        int i = hydropowerMapper.addhyDropE(hydropowerVo);
        return i;
    }

    @Override
    public String selectMaxByploteid(Integer eplotid) {
        String i = hydropowerMapper.selectMaxe(eplotid);
        if(i==null){
            return  "0";
        }else {
            return i;
        }
    }

    @Override
    public List<LineVo> selectallHydropower() {
        List<LineVo> lineVos = hydropowerMapper.selectallHydropower();
        return lineVos;
    }
    @Override
    public List<shuidianVo> selectallByplotidHydropower() {
        List<shuidianVo> shuidianVos = hydropowerMapper.selectallByplotidHydropower();
        return shuidianVos;
    }
}